/*
 * Evaluation.cpp
 *
 *  Created on: 2011-6-10
 *      Author: rs
 */

#include "Evaluation.h"

Evaluation::Evaluation(const RegionBoard& board):regBoard(board){
}

void Evaluation::constructMathMorphologyBoard(int d){
	int e = d*(d-1)+1;
	if (DEBUG_EVALUTATION) SgDebug()<<"mathBoard B\n";
	mathBoard = MathBoard(regBoard);
	if (DEBUG_EVALUTATION) SgDebug()<<"mathBoard E\n";
	if (DEBUG_EVALUTATION) mathBoard.display();
	for (int i=0; i<d; ++i)
		mathBoard.dilation();
	for (int i=0; i<e; ++i)
		mathBoard.erosion();
	if (DEBUG_EVALUTATION) mathBoard.display();
}

int Evaluation::value(){
	constructMathMorphologyBoard(4);
	return mathBoard.value();
}
